#!/usr/bin/env ruby

LKP_SRC = ENV['LKP_SRC'] || File.dirname(File.dirname(File.dirname(File.realpath($PROGRAM_NAME))))

require "#{LKP_SRC}/lib/tests/stats"

stats = LKP::Stats.new

while (line = $stdin.gets)
  case line
  when /([\d.]+:) (.*): FAILED!$/
    stats.add $2, 'fail'
  when /([\d.]+:) (.*): Ok$/
    stats.add $2, 'pass'
  when /([\d.]+:) (.*): (Skip$|Skip .*)/
    stats.add $2, 'skip'
  when /make perf passed/
    stats.add 'perf.make', 'pass'
  when /make perf failed/
    stats.add 'perf.make', 'fail'
  end
end

stats.dump
